# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=xorg-fonts-type1
pkgver=7.7
pkgrel=2
pkgdesc="X.org Type1 fonts"
arch=(any)
license=('custom')
url="https://xorg.freedesktop.org/"
depends=(xorg-fonts-encodings xorg-fonts-alias xorg-font-utils fontconfig)
source=(${url}/releases/individual/font/font-adobe-utopia-type1-1.0.4.tar.bz2
        ${url}/releases/individual/font/font-bh-type1-1.0.3.tar.bz2
        ${url}/releases/individual/font/font-bitstream-type1-1.0.3.tar.bz2
        ${url}/releases/individual/font/font-ibm-type1-1.0.3.tar.bz2
        ${url}/releases/individual/font/font-xfree86-type1-1.0.4.tar.bz2)
md5sums=('fcf24554c348df3c689b91596d7f9971'
         '53ed9a42388b7ebb689bdfc374f96a22'
         '5e0c9895d69d2632e2170114f8283c11'
         'bfb2593d2102585f45daa960f43cb3c4'
         '3eeb3fb44690b477d510bbd8f86cf5aa')

build() {
  cd "${srcdir}"
  for dir in *; do
    if [ -d "${dir}" ]; then
      pushd "${dir}"
      ./configure --prefix=/usr \
        --with-fontdir=/usr/share/fonts/Type1
      make
      popd
    fi
  done
}

package() {
  cd "${srcdir}"
  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  for dir in *; do
    if [ -d "${dir}" ]; then
      pushd "${dir}"
      make DESTDIR="${pkgdir}" install
      install -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.${dir%-*}"
      popd
    fi
  done
  rm -f "${pkgdir}"/usr/share/fonts/Type1/fonts.*
}
